<template>
	<view class="basic-box">
		
		<view class="ImgBox">
			<image :src="loginHealth.loginHealth?.avatar"></image>
		</view>
		<view class="form-item">
			<view class="msg-box">
				<text>真实姓名</text>
				<!-- <input v-model="contractStore.userInfo?.name"/> -->
				<span>{{loginHealth.loginHealth?.name}}</span>
	<!-- 			<span v-if="loginHealth.loginHealth?.name">{{loginHealth.loginHealth?.name}}</span>
				<input v-else type="text" v-model="loginHealth.loginHealth.name" placeholder="请输入"/> -->
			</view>
			<view class="msg-box">
				<text>身份证号</text>
				{{loginHealth.loginHealth?.IDnumber}}

			</view>
			<view class="msg-box">
				<text>联系电话</text>
				{{loginHealth.loginHealth?.phone}}
			</view>
			<view class="msg-box">
				<text>现居地址</text>
				{{loginHealth.loginHealth?.address}}
			</view>
			<view class="msg-box">
				<text>户籍地址</text>
				{{loginHealth.loginHealth?.address}}
			</view>



			<!-- <view class="form-item"> -->
			<view class="msg-box">
				<text>性别</text>
				<span v-if="loginHealth.loginHealth?.gender == 1">男</span>
				<span v-if="loginHealth.loginHealth?.gender == 0">女</span>
			</view>
			<!-- </view> -->
			<view class="msg-box">
				<text>出生日期</text>

				{{loginHealth.loginHealth?.birthday}}
				<!-- view style="font-size: 14px;color: #333;">
					{{birthdayText}}
				</view>
			<image src="https://cdn8.axureshop.com/demo/1689476/images/%E7%BB%84%E4%BB%B6_%E8%A7%84%E8%8C%83/u1334.png" mode=""></image> -->
				<!-- <u-datetime-picker :show="showTime" v-model="current" mode="date" :minDate="min" :maxDate="max"
					@confirm="onConfirm" @cancel="showTime = false" /> -->

			</view>
			<view class="msg-box">
				<text>工作单位</text>
			
				<input placeholder="请输入工作单位"  v-model="loginHealth.loginHealth.workUnit"/>
			</view>
			<view class="msg-box">
				<text>定点医疗单位</text>
				<input  placeholder="请输入医疗单位"  v-model="loginHealth.loginHealth.hospital"/>
				<!-- <input v-else placeholder="请输入医疗单位"/> -->
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';

	import {
		props
	} from '../../uni_modules/uview-plus';
	import {
		useUserStore
	} from '../../store/user';
	import {
		residentsSearchApi,
		residentsUpdateApi
	} from '../../api/setting';

	// 时间选择器
	const showTime = ref(false);
	const current = ref(Date.now());
	const birthdayText = ref('');
	const min = new Date('2014-01-01').getTime();
	const max = new Date('2025-12-31').getTime();

	const loginHealth = defineProps(['loginHealth'])
	// console.log(loginHealth);

	// 性别底部弹窗
	const showGender = ref(false);
	// 性别

	const genderValue = ref('')
	const genderId = ref()

	// 状态机
	const userStore = useUserStore();

	


	// console.log(999, userStore.userId);


	const genderData = ref([{
			name: '女',
			choose: 0
		},
		{
			name: '男',
			choose: 1
		}
	])

	// 确认回调

	const onConfirm = (e) => {
		// e.value 是时间戳
		const d = new Date(e.value);
		const y = d.getFullYear();
		const m = String(d.getMonth() + 1).padStart(2, '0');
		const day = String(d.getDate()).padStart(2, '0');
		birthdayText.value = `${y}-${m}-${day}`;
		showTime.value = false;
	};

	function chooseGender(choose, name) {
		genderValue.value = name
		// userItem.value.otherId.gender = choose
		showGender.value = false
	}


	// 性别打开方法
	const open = () => {
		showGender.value = true;
	}
</script>

<style scoped lang="scss">
	.basic-box {
		background-color: #f0f8ff;
	}

	.msg-box {
		width: 100%;
		height: 88rpx;
		display: flex;
		align-items: center;

		// justify-content: space-between;
		border-bottom: 1rpx solid #eee;
		font-size: 28rpx;

		text {
			margin-right: 50rpx;
			width: 180rpx;
			// font-size: 14px;
			font-weight: 400;
			font-style: normal;
			font-size: 14px;
			color: #999;
		}

		input {

			font-size: 14px;
		}

		image {
			width: 14rpx;
			height: 24rpx;
		}


	}

	.form-item {
		background: #fff;
		padding: 0 0rpx 0rpx 40rpx;
		margin-bottom: 20rpx;
	}

	.ImgBox {
		display: flex;
		justify-content: center;

		image {
			margin-top: 50rpx;
			margin-bottom: 50rpx;
			width: 148rpx;
			height: 148rpx;
			border-radius: 50%;
		}

	}
</style>